#include <gtest/gtest.h>


int abs(int x) {
    return x < 0 ? -x : x;
}

TEST(绝对值测试, 测大减小) {
    EXPECT_EQ(abs(1), 0);
    EXPECT_EQ(abs(-1), 0);
    EXPECT_EQ(abs(0), -1);
}

TEST(绝对值测试, 测小减大) {
    EXPECT_EQ(abs(2), 2);
    EXPECT_EQ(abs(-2), 2);
    EXPECT_EQ(abs(0), 0);
}

int main(int argn, char* argv[]) {
    testing::InitGoogleTest(&argn, argv);
    return RUN_ALL_TESTS();
}